<%@ page contentType="text/html;charset=utf-8" language="java"
	pageEncoding="UTF-8" import="java.util.Date"%>
<%@include file="../../common/mastertopedit.jsp"%>
<p class="page-title" style="background:#f6f6f6;margin-left:-20px;margin-right:-20px">
	<i class="locale-icon" style="margin-left:20px"></i> <span>当前位置 : </span> <span
		class="cur-page-title">修改密码</span> <span></span>
</p>

<div class="form-horizontal pt-15  form-clean-magin" style="padding-top:50px">
	<div class="form-group">
		<label for="inputEmail3"
			class="col-xs-3 text-right control-label usual-label">旧密码</label>
		<div class="col-xs-9">
			<input class="form-control form-control-260 pull-left"
				type="password" id="oldPwd" maxlength="100" type="text">
			<i class="plum-sign-right">*</i>
		</div>
	</div>
	
	<div class="form-group">
		<label for="inputEmail3"
			class="col-xs-3 text-right control-label usual-label">新密码</label>
		<div class="col-xs-9">
			<input class="form-control form-control-260 pull-left"
				type="password"  id="newPwd1" maxlength="100"   type="text" type="text">
			<i class="plum-sign-right">*</i>
		</div>
	</div>
	
	<div class="form-group">
		<label for="inputEmail3"
			class="col-xs-3 text-right control-label usual-label">确认新密码</label>
		<div class="col-xs-9">
			<input class="form-control form-control-260 pull-left"
				type="password"  type="text" id="newPwd2" maxlength="100" type="text">
			<i class="plum-sign-right">*</i>
		</div>
	</div>
</div>
<div class="form-group">
<label for="inputEmail3"
			class="col-xs-3 text-right control-label usual-label">&nbsp</label>
			<div class="col-xs-9">
	<button type="button" class="runmi-btn runmi-sure-btn"
		onclick="modifyPwd()">保存</button>
		</div>
</div>

<script type="text/javascript">
var flag=false;
function modifyPwd() {
	
    var oldPwd = $('#oldPwd').val();
    if(null==oldPwd || oldPwd=='') {
    	layer.alert('请输入旧密码',{icon: 1}, function(){
    		layer.closeAll();
    		$("#oldPwd").focus();
   		});      
        return;
    }
    var newPwd1 = $('#newPwd1').val();
    if (null == newPwd1 || newPwd1 == '') {
    	layer.alert('请输入密码',{icon: 1}, function(){
    		layer.closeAll();
    		$("#newPwd1").focus();
   		});      
        return;
        
    }
    var newPwd2 = $('#newPwd2').val();
    if (null == newPwd2 || newPwd2 == '') {
       
        layer.alert('请输入确认密码',{icon: 1}, function(){
        	 $("#newPwd2").focus();
        	 layer.closeAll();
  		});  
        return;
    }
    if(newPwd2!=newPwd1) {
        layer.alert('新密码两次输入不一致，请重新输入',{icon: 1}, function(){
       	 $("#newPwd2").focus();
       		layer.closeAll();
 		});  
        return;
    }
    var  parama =  "oldPwd=" + oldPwd;
    parama = parama + "&newPwd1=" + newPwd1 + "&newPwd2=" + newPwd2;
   /// alert(parama);
   layer.load(1, {shade: [0.5,'#fff']});
    var url = "savePwd";
    $.ajax({
        type: "POST",
        url: url,
        data: parama,
        contentType: "application/x-www-form-urlencoded;charset=UTF-8",
        async: true,
        dataType: 'json',
        error: function (datas) {
        //	layer.closeAll();
        },
        success: function (resultdata) {
        	layer.closeAll();
        	if(resultdata.returnCode=="0000"){     
            	layer.alert('修改密码成功');

           		 $('#oldPwd').val("");
                    $('#newPwd1').val("");
                    $('#newPwd2').val("");
      
               
            } else {
            	layer.alert(resultdata.returnMessage);
            }
        
        }
    });
}

</script>
<%@include file="../../common/masterbottom.jsp"%>
